import request from './request'
import { PageResDto, PageDto, FileUrlDto, ReportCaseResultDto } from '@/api/dto'
// 获取用户基本信息
export interface GetUserInfoResDto {
    sales_id: number
    is_super: boolean
    source: string
    mobile: string
    avatar: string
    name: string
}
export interface GetPayCompleteDto {
    accountExpireTime: string
    companyName: string
    conscientiousPeople: string
    expireTime: number
    id: number
    rechargeAmount: number
    accountBalance?: number
    businessPrincipal?: string
    productOpenTime?: string
    companyId:number
    insuranceType:number
    dealId:number
}
// PageDto&{name:string}
export function getPayComplete (data:PageDto&{searchText: string}): Promise<PageResDto<GetPayCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/pay-remind-seven-days-due', data)
}

export function getPayExpire (data:PageDto&{searchText: string}): Promise<PageResDto<GetPayCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/pay-remind-out-seven-date', data)
}

export interface GetInsureCompleteDto {
    accountBalance: number
    businessPrincipal: string
    companyName: string
    productOpenTime: string
}
// 微提醒 日日保 已投保接口列表
export function getInsureComplete (data:PageDto&{searchText: string, sortOrder:number|string, productType:number}): Promise<PageResDto<GetInsureCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/remind-insure-customer', data)
}

// 微提醒 日日保 未投保接口列表
export function getInsureExpire (data:PageDto&{searchText: string, sortOrder:number|string, productType:number}): Promise<PageResDto<GetInsureCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/remind-uninsure-customer', data)
}

export interface GetReportDto{
    companyId: number
    companyName: string
    id: number
    insuranceType: number
    insureCompanyType: string
    outDangerDate: string
    outDangerUserName: string
    reportStatus: number
    serveCompanyName: string
    isInform:number
    reportCaseResultList:ReportCaseResultDto[]
}
// 报案处理列表
export function getReport (data:PageDto&{
    companyName: string
    queryMonth: number | string
    startTime?: string
    endTime?: string
    reportStatus:number | string
    sortOrder:number
}): Promise<PageResDto<GetReportDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/get-reporting-handling', data)
}

export interface ReportDetailDto {
    isInform:number
    serveCompanyName:string
    reportStatus:number
    reportPhone:string
    reportCaseResultList:ReportCaseResultDto[]
    params:{
        fileUrl:FileUrlDto[]
    }
    outDangerUserName:string
    accidentDetails: string
    accidentType: number
    companyId: number
    companyName: string
    companyPlanName: string
    createTime: string
    estimateMoney: number
    finalMoney: number
    hurtStatus: number
    id: number
    insurStartTime: string
    insuranceType: number
    occupationLevel: string
    occupationName: string
    outDangerDate: string
    outDangerIdCardNo:string
    outDangerPhone: string
    outDangerPlace: string
}

// 报案详情信息
export function getReportDetail (data:{
    id: number
    insuranceType:number
}): Promise<ReportDetailDto> {
    return request.get('/api/v1/crm/sign-contract-record/get-report-details', data)
}
// 销售已告知接口 /api/v1/crm/sign-contract-record/insert-progress

export function saleNotice (data: {
    id:number
    insuranceType:number,
    remark:string
}): Promise<void> {
    return request.post('/api/v1/crm/sign-contract-record/insert-progress', data)
}

// 微提醒 长期保已投保列表
export function longInsureComplete (data:PageDto& {
    searchText:string
    sortOrder:string | number
}): Promise<PageResDto<GetInsureCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/get-period-insured-customer', data)
}
// 微提醒 长期保未投保列表
export function longInsureFail (data:PageDto& {
    searchText:string
    sortOrder:string | number
}): Promise<PageResDto<GetInsureCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/get-period-uninsured-customer', data)
}

// 微提醒  长期保日通余额不足列表
export function longInsureBalance (data:PageDto& {
    searchText:string
    sortOrder:number | string
}): Promise<PageResDto<GetInsureCompleteDto[]>> {
    return request.get('/api/v1/crm/sign-contract-record/get-balance-insufficient', data)
}
